
package main

import (
	"fmt"
)


type ListNode struct {
	     Val int
	     Next *ListNode
	 }

func main2()  {
	l1 :=ListNode{12,nil}
	l2 :=ListNode{10,&l1}
	l3:=ListNode{32,&l2}
	fmt.Println(l3)
	head := &l3
	fmt.Println(head.Next.Val)
	head.Next = head.Next.Next
	//  这里涉及到结点值和结点指针
	travel(head)

}
func travel(head *ListNode)  {
	for head!=nil{
		fmt.Println(head.Val)
		// 为什么这种赋值不是删除结点
		head = head.Next
	}
}